Skip to content

feat(windows): polish tray UX and route transitions - #230

Open
EnderXie23 wants to merge 2 commits into
Fei-Away:mainfrom
EnderXie23:windows-tray-transitions
Open

feat(windows): polish tray UX and route transitions#230
EnderXie23 wants to merge 2 commits into
Fei-Away:mainfrom
EnderXie23:windows-tray-transitions

Conversation

@EnderXie23

@EnderXie23 EnderXie23 commented Jul 23, 2026

Copy link
Copy Markdown

Summary / 摘要

  • Follow up on the maintainer-requested split from the closed original PR #145: this PR intentionally excludes the Furina preset and the earlier broad control/composer styling.
  • Rework route timing on top of the measured selector contract merged in #216: navigation now enters its readability veil in the same event turn, settles on the next animation frame, and drives the sidebar/main overlays from one inherited 380 ms progress value.
  • Polish the Windows tray with a rounded, content-sized Codex-style menu, matching rounded submenus, compact DPI-safe typography, semantic status colors, a branded fallback icon, clearer stop/restore/Studio actions, and safe item disposal.
  • Start the tray once as a hidden STA child only after launch verification succeeds. The launcher returns normally, while the existing mutex prevents duplicate background tray hosts.
  • Extend canonical runtime, generated macOS/Windows assets, tray-native checks, route-timing regressions, Windows transaction tests, changelogs, and launcher documentation.

Type / 类型

  • Bug fix / 缺陷修复
  • Feature / 新功能
  • Docs / 文档
  • Theme / CSS / visual / 主题或视觉
  • Scripts / install / restore / 脚本或安装恢复
  • Chore / 杂项

Platform / 平台

  • macOS
  • Windows
  • Both / 双平台
  • Docs / repo only / 仅文档或仓库元数据

The tray and detached launcher are Windows-specific. Route timing is changed in the canonical runtime and synchronized byte-for-byte to both platform asset trees, per #216.

Self-check / 自测

Check what you actually ran. Skip items that do not apply and say so under Notes.
请勾选实际跑过的项;不适用的在 Notes 说明。

Docs-only / 仅文档

  • Links and wording reviewed / 已检查链接与表述

macOS (when code under macos/ changes)

  • macos/tests/run-tests.sh passed / 已通过
  • Doctor (optional): macos/scripts/doctor-macos.sh
  • Live verify (if inject/CSS/start path): verify-dream-skin-macos.sh or Desktop Verify
  • Restore / re-apply smoke (if install/restore/start changed) / 若改了安装恢复启动则做过恢复再应用

Windows (when code under windows/ changes)

  • Relevant install / start / verify / restore scripts exercised / 已按改动跑过对应脚本
  • Environment noted below (OS build, Codex source) / 下方注明环境

User-facing / 用户可见变更

  • Updated macos/CHANGELOG.md (and macos/VERSION if release-worthy) / 已更新 changelog(发版时再 bump VERSION)
  • N/A — no user-facing change / 无用户可见变更

Security / 安全

  • Does not modify official Codex install / asar / signatures / 未修改官方安装与签名
  • Does not silently write API Base URL or keys / 未静默写入 API Base URL 或 Key
  • CDP remains loopback-oriented (127.0.0.1) where applicable / CDP 仍仅本机回环(如适用)

Root cause and behavior / 根因与行为

  • The previous route handler delayed selector remeasurement by 180 ms. That made navigation feel unresponsive, while separately switched sidebar/main gradients could reveal at different times.
  • The new runtime writes data-dream-route-phase=prepare during the navigation event, advances to settling on the next animation frame, and cancels/replaces prior frames and timers. It still avoids DOM-subtree observation, layout reads, and Codex business-class mutation.
  • The original tray inherited dense classic ContextMenuStrip geometry and could throw when its first item was added to an empty collection. The new native renderer uses rounded clipped surfaces, neutral hover/divider styling, content-driven width, a consistent text grid, safe empty-menu insertion, and explicit resource cleanup.
  • start-dream-skin.ps1 starts the tray only after verification and only when the tray mutex is free, so the foreground launcher does not remain occupied.

Notes / 补充

  • Base: current upstream main at 0f00dce (includes feat(runtime): unify cross-platform skin runtime behind measured selector contract #216).
  • Environment: Windows build 26200.8655; Windows PowerShell 5.1.26100.8655; Node.js v24.13.1; registered Microsoft Store OpenAI.Codex package.
  • Visual verification: the rounded main menu/submenu, compact DPI-scaled layout, content-hugging width, hover state, and green/brown/red status subtitle were reviewed manually on Windows.
  • Passed:
    • node --check runtime/renderer-inject.js
    • node --check windows/assets/renderer-inject.js
    • node --check macos/assets/renderer-inject.js
    • node tools/sync-runtime-assets.mjs --check
    • node tools/doctor-selectors.test.mjs
    • node --test tools/renderer-runtime.test.mjs
    • node --test windows/tests/renderer-inject.test.mjs
    • node --test macos/tests/renderer-inject.test.mjs
    • powershell.exe -NoProfile -STA -ExecutionPolicy RemoteSigned -File windows/scripts/tray-dream-skin.ps1 -SelfTest
    • powershell.exe -NoProfile -ExecutionPolicy Bypass -File windows/tests/run-tests.ps1
    • git diff --check
  • The forced-cleanup warnings in windows/tests/run-tests.ps1 are intentional fault-injection fixtures; the suite completed with PASS.
  • macOS full shell/doctor/live verification was not available on this Windows host. The shared runtime sync check and both generated renderer test entry points passed.
  • Windows live verification remains unchecked: current main's verify-dream-skin.ps1 calls Get-DreamSkinThemePaths without importing theme-windows.ps1, so the standalone verifier stops before CDP inspection. This PR does not expand into that unrelated existing verifier bug.
  • Open-PR audit (2026-07-23) found no other open PR targeting the tray-menu renderer. The only other tray matches, fix(windows): require exact cleanup process identity #148 and Reduce Windows AV heuristic triggers #150, do not change windows/scripts/tray-dream-skin.ps1; their scope is cleanup identity and AV/installation policy.
  • The screenshot below is the requested tray-only capture; unrelated private windows/artifacts/ files remain excluded.

Screenshot / 截图

Rounded Windows tray menu and saved-theme submenu

Rounded, content-sized Windows tray menu with semantic status color and a matching saved-theme submenu.

@EnderXie23
EnderXie23 marked this pull request as ready for review July 23, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant